package com.atguigu.edusugar.mapper;

import com.atguigu.edusugar.bean.VideoPlay;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface videoPlayMapper {
    @Select("select count(distinct sid)                  play_count,\n" +
            "       count(distinct play_people)                  play_people,\n" +
            "       sum(play_time)                       play_total_time,\n" +
            "       cast( sum(play_time) / count(distinct dws_chapter_play.play_people) as decimal(16,2)) avg_play_time,\n" +
            "       chapter_id,\n" +
            "       chapter_name\n" +
            "from dws_chapter_play\n" +
            "where toYYYYMMDD(stt) = 20221028\n" +
            "group by chapter_id,\n" +
            "         chapter_name")
    List<VideoPlay> listVP(int date);
}
